
$(function () {
    function Device() {
        if(!$config.IsPC()){
            document.body.style.display = 'block';
        }else{
            location.href = 'index.html';
        }
    }

    $(window).resize(function () {
        Device();
    })

    Device();

    // 监听自动播放音乐
    (function () {
        var audio = document.querySelector('audio');
        document.addEventListener('WeixinJSBridgeReady',function () {
            audio.play();
        },false)
    
        // 音乐控制
        $('.music').click(function(){
            if(audio!==null) {
                if(audio.paused){
                    audio.play();
                    $('.music').addClass('on');
                }else{
                    audio.pause();
                    $('.music').removeClass('on');
                }
            }
        });
        
    })()
    
    

    var swiper = new Swiper('.swiper-container', {
        // loop: true,
        direction: 'vertical',
        paginationClickable : true,
        // simulateTouch : false,
        onInit: function(swiper){ //Swiper2.x的初始化是onFirstInit
            swiperAnimateCache(swiper); //隐藏动画元素
            swiperAnimate(swiper); //初始化完成开始动画
        },
        onSlideChangeEnd: function(swiper){
            swiperAnimate(swiper); //每个slide切换结束时也运行当前slide动画
        }
    })

    //打开、关闭报名信息弹出框
    $('.sign-way-open').click(function () {
        $('.sign-way').show();
    })
    $('.sign-way-close').click(function () {
        $('.sign-way').hide();
    })
})